<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var day = prompt("请输入1-31日内的一个日期");
      var date = day % 7;
      if (day <= 31) {
        switch (date) {
          case 1:
            alert("今天星期一");
            break;
          case 2:
            alert("今天星期二");
            break;
          case 3:
            alert("今天星期三");
            break;
          case 4:
            alert("今天星期四");
            break;
          case 5:
            alert("今天星期五");
            break;
          case 6:
            alert("今天是周六");
            break;
          case 0:
            alert("今天是周日");
            break;
        }
      } else {
        alert("天数最多只有31天奥");
      }
    </script>
  </body>
</html>
